package com.joejag.mavenstats.client.service;

import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.core.client.GWT;


public interface ParserService extends RemoteService
{
   String getProjectName(String url);

   /**
    * Utility/Convenience class.
    * Use ParserService.App.getInstance() to access static instance of ParserServiceAsync
    */
   public static class App
   {
      private static ParserServiceAsync ourInstance = null;

      public static synchronized ParserServiceAsync getInstance()
      {
         if (ourInstance == null)
         {
            ourInstance = (ParserServiceAsync) GWT.create(ParserService.class);
            ((ServiceDefTarget) ourInstance).setServiceEntryPoint(GWT.getModuleBaseURL() + "com.joejag.mavenstats.MavenStats/ParserService");
         }
         return ourInstance;
      }
   }
}
